package de.baumann.browser.views.dialog

import android.app.Dialog
import android.content.Context
import android.view.Gravity
import de.baumann.browser.OdinGlideModule
import de.baumann.browser.R
import de.baumann.browser.api.net.vo.duobao.ZJXX
import de.baumann.browser.utils.StringUtil
import kotlinx.android.synthetic.main.dialog_zjxx.*

class ZJXXDialog(context: Context) : BaseDialog(context) {
    override fun laoutId(): Int {
        return R.layout.dialog_zjxx
    }

    override fun gravity(): Int {
        return Gravity.BOTTOM
    }

    override fun initView() {
        close.setOnClickListener {
            dismiss()
        }
    }


    fun setData(zjxx: ZJXX): Dialog {
        OdinGlideModule.loadWithCropAndCircle(context, zjxx.avatar, zjtx, R.drawable.icon_head)
        zjnc.text = zjxx.userName
        zjdz.text = StringUtil.StrReplace(zjxx.address)
        zjhm.text = "幸运号码:${zjxx.winNum}"
        cyrs.text = "参与人数:${zjxx.joinNum}人"
//        zxfe.text = "总需份额:${zjxx.}"
        jssj.text = "结束时间:${zjxx.createTime}"
        jsqks.text = "结束时期区块数:${zjxx.finishBlock}"
        dyhash.text = "对应Hash后五位：${zjxx.finishHash}"
        jyxxcx.text = zjxx.websiteAddress
        return this
    }
}